home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / gdb / sprite / i386_procDebugRegs.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-11-15  |  2.2 KB  |  86 lines

  1. /* 
  2.  * procDebugRegs.c --
  3.  *
  4.  *    Convert registers between the format expected by the ptrace system
  5.  *    call and that of the Sprite Proc_Debug call.
  6.  *
  7.  * Copyright 1989 Regents of the University of California
  8.  * Permission to use, copy, modify, and distribute this
  9.  * software and its documentation for any purpose and without
  10.  * fee is hereby granted, provided that the above copyright
  11.  * notice appear in all copies.  The University of California
  12.  * makes no representations about the suitability of this
  13.  * software for any purpose.  It is provided "as is" without
  14.  * express or implied warranty.
  15.  */
  16.  
  17. #ifndef lint
  18. static char rcsid[] = "$Header: /sprite/lib/forms/RCS/proto.c,v 1.2 89/01/07 04:12:18 rab Exp $ SPRITE (Berkeley)";
  19. #endif /* not lint */
  20.  
  21. #include "sprite.h"
  22. #include "status.h"
  23. #include "sys/ptrace.h"
  24. #include <errno.h>
  25. #include <proc.h>
  26. #include <signal.h>
  27. #include <sys/wait.h>
  28. #include "procDebugRegs.h"
  29.  
  30.  
  31. /*
  32.  *----------------------------------------------------------------------
  33.  *
  34.  * procDebugToPtraceRegs --
  35.  *
  36.  *    Convert registers from a proc debug format to a ptrace format.
  37.  *
  38.  * Results:
  39.  *    None.
  40.  *
  41.  * Side effects:
  42.  *    None.
  43.  *
  44.  *----------------------------------------------------------------------
  45.  */
  46.  
  47. void
  48. procDebugToPtraceRegs(regStatePtr, ptraceRegsPtr)
  49.     Mach_RegState    *regStatePtr; /* Register state as returned by 
  50.                        * the PROC_GET_DBG_STATE argument
  51.                        * to Proc_Debug. */
  52.     char    *ptraceRegsPtr;          /* Memory to put ptrace format of
  53.                        * registers. */
  54.  
  55. {
  56.     bcopy((char *)regStatePtr, ptraceRegsPtr, sizeof(Mach_RegState));
  57. }
  58.  
  59.  
  60. /*
  61.  *----------------------------------------------------------------------
  62.  *
  63.  * ptraceToProcDebugRegs --
  64.  *
  65.  *    Convert registers from a ptrace format to a proc debug format.
  66.  *
  67.  * Results:
  68.  *    None.
  69.  *
  70.  * Side effects:
  71.  *    None.
  72.  *
  73.  *----------------------------------------------------------------------
  74.  */
  75.  
  76. void
  77. ptraceToProcDebugRegs(ptraceRegsPtr, regStatePtr)
  78.     char    *ptraceRegsPtr;          /* Memory image of ptrace format of
  79.                        * registers. */
  80.     Mach_RegState    *regStatePtr; /* Register state as used by Proc_Debug */
  81.  
  82. {
  83.     bcopy(ptraceRegsPtr, (char *)regStatePtr, sizeof(Mach_RegState));
  84. }
  85.  
  86.